After specifying the NIS domains to be used by the Data ONTAP 10.0 system's virtual servers, configuring the virtual servers to provide NFS and CIFS access and to use Kerberos authentication, and creating CIFS shares, you can create name mappings.
To create a name mapping, use the protocol name-mapping new command, and specify the following information:
Virtual server name
Type of mapping (user or group)
Mapping direction (krb-unix, win-unix, or unix-win)
Position of the mapping in the priority list
Pattern to be matched, up to 256 characters in length
Replacement pattern, up to 256 characters in length
When Windows-to-UNIX mappings are created, any CIFS clients that have open connections to the Data ONTAP 10.0 system at the time the new mappings are created must log out and log back in to see the new mappings.
The following example creates a name mapping on a virtual server named vs0. The mapping is a group mapping from UNIX to Windows at position 1 in the priority list. The mapping maps the UNIX group cifs to the Windows group ENG\Domain Users.
node::>protocol name-mapping new -vserver vs0 -type group -direction unix-win -position 1 -pattern cifs -replacement "ENG\\Domain Users"
The following example creates another name mapping on a virtual server named vs0. The mapping is a user mapping from Windows to UNIX at position 1 in the priority list. The mapping maps every CIFS user in the domain ENG to users in the NIS domain associated with the virtual server.
node::>protocol cifs-nfs new -vserver vs0 -type user -direction win-unix -position 1 -pattern "ENG\\(.+)" -replacement "\1"
You can load one or more name mappings into a Data ONTAP 10.0 system from a universal resource identifier (URI) by using the protocol name-mapping load-from-uri command. You can specify whether the loaded name mappings overwrite existing name mappings. The URI must list name mappings in the following format:
virtual_server_nametypedirectionpositionpatternreplacement
The following is an example:
vs0 user krb-unix 2 "([^@/]+)(/[^@]+)?@ENG.EXAMPLE.COM" "\1" vs0 user win-unix 2 "ENG\\(.+)" "\1" vs0 user unix-win 2 "(.+)" "ENG\\\1"
The following example loads name mappings from the URI tftp://tftp.example.com/mappings/name-map.txt, and does not overwrite existing name mappings:
node::>protocol name-mapping load-from-uri -uri tftp://tftp.example.com/mappings/name-map.txt -overwrite false
To display information about name mappings, use the protocol name-mapping show command. The command displays the same information that is specified with the protocol name-mapping new command. Other information is displayed in a detailed view and if other parameters are specified. See the reference page for the command for details.
The following example displays information about all name mappings.
node::>protocol name-mapping showVirtual Mapping Direction Pos Pattern Replacement Server Type vs0 user win-unix 1 ENG\(.+) \1 group unix-win 1 cifs ENG\Domain Users
You can use the protocol name-mapping insert command to create a name mapping at a specified position in the priority list. The command rearranges the list as needed to accommodate the new entry. For instance, if you have a priority list of five mappings and insert a new mapping at position 3, the mapping previously at position 3 is moved to position 4, the mapping previously at position 4 is moved to position 5, and the mapping previously at position 5 is moved to position 6. Each mapping direction (Kerberos to UNIX, Windows to UNIX, and UNIX to Windows) has its own priority list.
The following example creates a name mapping on a virtual server named vs0. It is a user mapping from Kerberos to UNIX and is inserted into the priority list at position 2. The name mapping maps any principal in the Kerberos realm ENG.EXAMPLE.COM to the UNIX user name corresponding to the principal's base name with any instance names removed; for example, tom/admin@ENG.EXAMPLE.COM is mapped to tom.
node::> protocol name-mapping insert -vserver vs0 -type user
-direction krb-unix -position -2
-pattern "([^@/]+)(/[^@]+)?@ENG.EXAMPLE.COM" -replacement "\1"You can use the protocol name-mapping swap command to exchange the positions of two name mappings in the same priority list. Each mapping direction has its own priority list, so you cannot exchange mappings between the priority lists of different directions. However, you can exchange the positions of user and group mappings within the same priority list.
The following example exchanges the positions of two name mappings on a virtual server named vs0. The name mappings have the direction Kerberos to UNIX, and the first mapping has the mapping type user. The name mappings are exchanged between positions 3 and 6.
node::>protocol name-mapping swap -vserver vs0 -type user -direction krb-unix -position 3 -with-position 6
To modify the pattern, replacement pattern, or both of a name mapping, use the protocol name-mapping modify command. The following example modifies a name mapping on a virtual server named vs0. The mapping has the type group, the direction unix-win, and is at position 2. The replacement pattern is changed to "SALES\(.+)".
node::>protocol name-mapping modify -vserver vs0 -type group -direction unix-win -replacement "SALES\\(.+)"